<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function Calculator() {
        // let this = {};
        this.x = 0;
        this.y = 0;
        this.read = function () {
          this.x = +prompt("x?");
          this.y = +prompt("y?");
        };
        this.sum = function () {
          return this.x + this.y;
        };
        this.mul = function () {
          return this.x * this.y;
        };
        // return this;
      }
      let calculator = new Calculator();
      calculator.read();

      console.log("Sum=" + calculator.sum());
      console.log("Mul=" + calculator.mul());
    </script>
  </body>
</html>
